/**
 * 
 */
package com.digitalart.futbol.hibernate.ejb;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import org.codehaus.jackson.annotate.JsonBackReference;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonManagedReference;

/**
 * @author johitan90
 *
 */

@Entity
public class Local implements Serializable{

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id_local;
	
	@Column
	private String direccion_exacta;
	
	@Column
	private String foto;
	
	@Column
	private String nombre;
	
	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="local")
	
	private List<Cancha> canchas;
	
	@ManyToOne
	@JoinColumn(name="id_distrito")
	@JsonBackReference("locales")
	private Distrito distrito;
	
	@Column
	private boolean deleted;
	
	/**
	 * 
	 */
	public Local() {
		// TODO Auto-generated constructor stub
	}


	/**
	 * @return the id_local
	 */
	public int getId_local() {
		return id_local;
	}


	/**
	 * @param id_local the id_local to set
	 */
	public void setId_local(int id_local) {
		this.id_local = id_local;
	}


	/**
	 * @return the direccion_exacta
	 */
	public String getDireccion_exacta() {
		return direccion_exacta;
	}


	/**
	 * @param direccion_exacta the direccion_exacta to set
	 */
	public void setDireccion_exacta(String direccion_exacta) {
		this.direccion_exacta = direccion_exacta;
	}


	/**
	 * @return the foto
	 */
	public String getFoto() {
		return foto;
	}


	/**
	 * @param foto the foto to set
	 */
	public void setFoto(String foto) {
		this.foto = foto;
	}


	/**
	 * @return the canchas
	 */
	public List<Cancha> getCanchas() {
		return canchas;
	}


	/**
	 * @param canchas the canchas to set
	 */
	public void setCanchas(List<Cancha> canchas) {
		this.canchas = canchas;
	}


	public Distrito getDistrito() {
		return distrito;
	}


	public void setDistrito(Distrito distrito) {
		this.distrito = distrito;
	}


	public boolean isDeleted() {
		return deleted;
	}


	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}


	public String getNombre() {
		return nombre;
	}


	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

}
